package org.graduates.webapp.actions.course;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.graduates.webapp.actions.BaseAction;
import org.projects.graduates.domain.Course;
import org.projects.graduates.domain.PersonUser;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 确认开课
 * @author Administrator
 *
 */
public class CommitSetUpAction extends BaseAction {
	private static final long serialVersionUID = 3282691883854891518L;

	private Course course;
	
	@Action(results={@Result(name="success", type="redirect", location="arrangement-course.action",params={"courseId","${course.id}"}),
					@Result(name="input", type="redirect", location="set-up-course.action")})
	public String execute() {
		if(null == course){
			return ActionSupport.INPUT;
		}
		gradApplication.setUp(PersonUser.getPersonBy(getCurrentUser()),course);
		return ActionSupport.SUCCESS;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

}
